<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;

$this->title = '往期试卷';
$or = ['×','√'];
$color = ['red','green'];
$states = yii::$app->params['paperinfostate'];
?>
<style>
    li{list-style:none;}
</style>
<table class="table table-bordered">
    <thead>
        <th>总得分</th>
        <th>状态</th>
        <th>单选题</th>
        <th>多选题</th>
        <th>判断题</th>
        <th>填空断题</th>
        <th>大题</th>
        <th>满分</th>
    </thead>
    <tbody>
        <td><?=$scoreinfo['allscore']?></td>
        <td><?=$states[$scoreinfo['state']]?></td>

        <td><?=$scoreinfo['radioscore']?></td>
        <td><?=$scoreinfo['checkboxscore']?></td>
        <td><?=$scoreinfo['judgescore']?></td>
        <td><?=$scoreinfo['completionscore']?></td>
        <td><?=$scoreinfo['bossscore']?></td>
        <td><?=$scoreinfo['fullmarks']?></td>
    </tbody>
</table>



<h2><?= $examname  ?></h2>

<!--nr start-->
<div class="test_main">
    <div class="nr_left">
        <div class="test"  style="margin-bottom:45px;">



            <div class="test_content">
                <div class="test_content_title">
                    <h2>单选题</h2>

                </div>
            </div>
            <div class="test_content_nr">
                <ul>
                    <!-- 单选题  -->
                    <?php foreach($examinationInfo['radio'] as $key => $value): ?>
                        <li id="radio_<?=$key ?>">
                            <div class="test_content_nr_tt">
                                <i><?=$key+1;?></i><span>(<?=$selscore;?>分)
                                </span><font><?= $value['title'] ?>（ ）<font color="<?= $value['answer']==$value['ss']? 'green':'red';?>">真确答案：<?=$value['answer']?></font></font><b class="icon iconfont"></b>
                            </div>

                            <div class="test_content_nr_main">
                                <ul>
                                    <?php $rares = json_decode($value['options'],1);
                                    foreach($rares as $optionskey => $optionsvalue): ?>
                                        <li class="option">

                                            <label >
                                                <input type="radio" class="radioOrCheck"
                                                       id="0_answer_1_option_1" name="radio<?=$key ?>" value="<?=$controlleroptions[$key]?>"

                                                    <?=$value['ss'] == $controlleroptions[$optionskey]?'checked':'';?>
                                                       disabled
                                                />


                                                <?= Html::encode($controlleroptions[$optionskey])?>.
                                                <p class="ue" style="display: inline;"><?=Html::encode($optionsvalue);?></p>
                                            </label>
                                        </li>
                                    <?php endforeach; ?>
                                </ul>
                            </div>
                        </li>
                    <?php endforeach; ?>

                    <!-- 单选题 end -->

                </ul>
            </div>

            <div class="test_content">
                <div class="test_content_title">
                    <h2>多选题</h2>

                </div>
            </div>
            <div class="test_content_nr">
                <ul>
                    <!--  左边多选题 -->
                    <?php foreach($examinationInfo['checkbox'] as $k => $v): ?>
                        <li id="checkbox_<?=$k;?>">
                            <div class="test_content_nr_tt">
                                <i><?=$k+1;?></i>
                                <span>(<?=$chescore?$chescore:'';?>分)</span>
                                <?php  $ckr = is_array($v['ss']) ? implode('&',$v['ss']) : $v['ss'];?>
                                <font><?=$v['title']?>() <font color="<?= !strcmp( $v['answer'], $ckr) ? 'green':'red';?>">真确答案：<?=$v['answer']?></font></font>
                            </div>

                            <div class="test_content_nr_main">
                                <ul>
                                    <?php $relops = json_decode($v['options']);?>
                                    <?php foreach ($relops as $key => $value): ?>
                                        <li class="option">
                                            <label>
                                                <input type="checkbox" class="radioOrCheck"
                                                       id="1_answer_1_option_1"

                                                       value="<?=$controlleroptions[$key]?>"
                                                    <?php
                                                    if( isset($v['ss'][$key]) && ($v['ss'][$key] ==$controlleroptions[$key]) ){
                                                        echo 'checked';
                                                    }
                                                    ?> disabled/>
                                                <p class="ue" style="display: inline;"> <?=$controlleroptions[$key]?>. <?=$value;?></p>
                                            </label>
                                        </li>

                                    <?php endforeach ?>


                                </ul>
                            </div>
                        </li>
                    <?php endforeach; ?>
                    <!--  左边多选题 end -->

                </ul>
            </div>

            <!-- 判断 -->
            <div class="test_content">
                <div class="test_content_title">
                    <h2>判断题</h2>

                </div>
            </div>
            <div class="test_content_nr">
                <ul>
                    <?php foreach ($examinationInfo['judge'] as $key => $value):

                        ?>


                        <li id="judge_<?=$key;?>">
                            <div class="test_content_nr_tt">
                                <i><?= $key+1;?></i><span></span><font><?= $value['title']; ?> （ ）
                                    <font color="<?= $value['is_true']==$value['ss']? 'lime':'red';?>">真确答案：<?=$or[$value['is_true']]?></font>
                            </div>

                            <div class="test_content_nr_main">
                                <ul>

                                    <li class="option">

                                        <label>
                                            <input type="radio" class="radioOrCheck"
                                                   id="0_answer_1_option_1" value="1" <?=$value['ss']==1?'checked':'';?> disabled/>
                                            <p class="ue" style="display: inline;">√</p>
                                        </label>
                                    </li>

                                    <li class="option">

                                        <label >
                                            <input type="radio" class="radioOrCheck"
                                                   id="0_answer_1_option_2"  value="0" <?=$value['ss']==0?'checked':'';?> disabled/>
                                            <p class="ue" style="display: inline;">×</p>
                                        </label>
                                    </li>

                                </ul>
                            </div>
                        </li>
                    <?php endforeach ?>
                </ul>
            </div>


            <!-- 填空 -->
            <div class="test_content">
                <div class="test_content_title">
                    <h2>填空题</h2>

                </div>
            </div>
            <div class="test_content_nr">
                <ul>
                    <?php foreach ($examinationInfo['completion'] as $key => $value): ?>
                        <li id="completion_<?=$key;?>">
                            <div class="test_content_nr_tt">
                                (<?= $cmpscore;?>)分 <i><?=$key+1 ?></i><span></span><font>
                                    <?= $value['title'] ?></font><b class="icon iconfont">&#xe881;</b>
                            </div>

                            <div class="test_content_nr_main">
                                <ul>
                                    <?php for($i=0;$i<count($value['ss']);$i++): ?>
                                        <li class="options">
                                            <div class="input-group">
                                                <span class="input-group-addon"><?= $i+1; ?>.</span>
                                                <input type="text" class="form-control" name="completion[<?=$key;?>][<?=$i;?>]" style="padding:.5rem;" value="<?=$value['ss'][$i] ?>" disabled>
                                            </div>
                                        </li>

                                    <?php endfor; ?>
                                </ul>
                            </div>
                        </li>

                    <?php endforeach ?>
                </ul>
            </div>
            <!-- 填空end  -->
            <!--  大题  -->
            <div class="test_content">
                <div class="test_content_title">
                    <h2>简答题</h2>

                </div>
            </div>
            <div class="test_content_nr">
                <ul>
                    <?php foreach ($examinationInfo['boss'] as $key => $value): ?>
                        <li id="boss_<?=$key;?>">
                            <div class="test_content_nr_tt">
                                (<?= $bosscore;?>)分 <i><?=$key+1 ?></i><span></span><font>
                                    <?= $value['title'] ?></font><b class="icon iconfont">&#xe881;</b>
                            </div>

                            <div class="test_content_nr_main">
                                <textarea class="form-control" rows="10" style="width:100%;resize:none;" name="boss[<?=$key;?>]" disabled><?=$value['ss']?></textarea>
                            </div>
                        </li>

                    <?php endforeach ?>
                </ul>
            </div>

        </div>






    </div>